// Written by Dale J Williams.
// Licensed under MPL 1.1 unless otherwise specified. 
// http://www.mozilla.org/MPL/MPL-1.1.html

package engineDJW.screens {
	
	import engineDJW.display.Widget;
	import engineDJW.screens.ScreenManager;
	import flash.events.Event;
	
	/**
	 * GameScreen
	 * @author Dale J Williams
	 */
	public class GameScreen extends Widget {
		
		static public const ADDED	:String = "screen added";
		static public const REMOVED	:String = "screen removed";
		
		static public const WIDTH	:int = 974;
		static public const HEIGHT	:int = 680;
		
		private var _manager	:ScreenManager;
		
		public function GameScreen($name:String) { 
			name = $name;
			_width = WIDTH;
			_height = HEIGHT;
		}
		
		/// animate the screen in
		public function animIn():void {
			animInComplete();
		}		
		
		/// implicitly called, should occur when the screen has finished animating in
		protected function animInComplete():void {
			dispatchEvent(new Event(ADDED));
		}
		
		/// animate the screen out
		public function animOut():void {
			animOutComplete();
		}
		
		/// implicitly called, should occur when the screen has finished animating out
		protected function animOutComplete():void {
			dispatchEvent(new Event(REMOVED));
		}
		
		/// a reference to the screen manager that is managing this screen
		public function get manager():ScreenManager { return _manager; }		
		public function set manager(value:ScreenManager):void {
			_manager = value;
		}
		
	}

}